package gui.wizard;

import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;

public class WelcomePage extends WizardPage {

	public WelcomePage() {
		super("WelcomePage");
		setTitle("Welcome to VWorld");
	}

	public void createControl(Composite parent) {
		ScrolledComposite composite = new ScrolledComposite(parent,
				SWT.H_SCROLL | SWT.V_SCROLL);
		Composite welcomeComposite = new Composite(composite, SWT.NONE);
		welcomeComposite.setLayout(new FillLayout(SWT.VERTICAL));
		new Label(welcomeComposite, SWT.LEFT)
				.setText("You have to create an avatar!");
		composite.setContent(welcomeComposite);
		setControl(composite);

		setPageComplete(true);

		welcomeComposite.setSize(welcomeComposite.computeSize(SWT.DEFAULT,
				SWT.DEFAULT));
	}

	public boolean canFlipToNextPage() {
		return true;
	}

	public IWizardPage getNextPage() {
		if (canFlipToNextPage()) {
			CreationAvatarPage creationAvatarPage = (CreationAvatarPage) super
					.getNextPage();
			return creationAvatarPage;
		}
		return null;
	}
}